JavaScript Beginners: Learn Java Script Programming Language, Basics Concept & Practice by Example by Digital Press Scorpio
Author:Digital Press , Scorpio [Digital Press , Scorpio]
Language: eng
Format: epub
Publisher: Scorpio Digital Press
Published: 2019-08-11T16:00:00+00:00
Chapter Three: An Introduction to Loops
Loops are for when you have to do a similar task multiple times. Say for example, you have to write the names of your guests who are coming to your event. How are you going to translate that into JavaScript? Sure, you can go ahead and try to set each name into a specific variable, but this will be very time consuming. It might work for you when there’re maybe ten or twenty guests, but how about when there are a hundred? You don’t want your arm to fall off right? Therefore, it is essential to learn the basics of “Loops”.
Loops in JavaScript simply enable a programmer to do a similar task repeatedly with very little effort.
For example, instead of writing:
Text += houses[0] + “<br>”
Text += houses[1] + “<br>”
Text += houses[2] + “<br>”
Text += houses[3] + “<br>”
You can just write:
for (i = 0; i<houses.length; i++) {
text += houses[i] + "<br>";
}
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(25294)
Hello! Python by Anthony Briggs(24339)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(23434)
Kotlin in Action by Dmitry Jemerov(22512)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(21976)
Dependency Injection in .NET by Mark Seemann(21848)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(20715)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(19523)
Grails in Action by Glen Smith Peter Ledbrook(18609)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17034)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(15843)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(13690)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11857)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11151)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10621)
Hit Refresh by Satya Nadella(9202)
The Kubernetes Operator Framework Book by Michael Dame(8570)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8408)
Robo-Advisor with Python by Aki Ranin(8361)